<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Dcc报表查询</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta content="no-cache, no-store, must-revalidate" http-equiv="Cache-Control"/>
    <meta content="no-cache" http-equiv="Pragma"/>
    <meta content="0" http-equiv="Expires"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=8">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <link rel="stylesheet" href="../styles/base.css"/>
    <link rel="stylesheet" href="../styles/common.css"/>
    <link rel="stylesheet" href="../styles/font/iconfont.css"/>
    <link rel="stylesheet" href="../styles/pages/tabs.css"/>
    <link rel="stylesheet" href="../jqueryNicepage/css/layui.css"  media="all">
    <link rel="stylesheet" href="../styles/pages/calendar.css">
    <link rel="stylesheet" href="../styles/jquery.multiselect.css"/>
    <style>
        body{
            background:#ddecf5;
            min-width: 1300px;
            /* overflow: hidden;*/
        }
        .boxContainer{
            left:10px;
        }
        #loading{
            left:50%;
            top:150px;
        }
        .queryCondition{
            width:100%;
            min-height:80px;
            line-height: 30px;
            margin-top: 10px;
            padding-bottom: 10px;
            height:auto;
            border-bottom:2px solid #ccc;
        }
        .queryCondition span{
            display: inline-block;
            /* margin-top: ;*/
        }
        .selectedItem{
            float:left;
            /*  margin-top: 20px;*/
            height:60px;
            min-width: 240px;
            width:auto;
            line-height: 60px;
            font-size: 16px;
            padding-right: 30px;
            /*padding-left:5px;*/
        }
        .layui-form{
            width:170px;
            margin-top: 20px;
            margin-left: 12px;
            /* float:left;*/
            margin-right: 10px;
        }
        .layui-input-block {
            margin-left: 20px;
            min-height: 36px;
        }
        #dt ,#dt1,#dt2{
            height: 38px;
            width: 150px;
            padding: 0 6px;
            border: 1px solid #ccc;
            box-sizing: border-box;
            font-size: 14px;
            outline: none;
            line-height: 38px;

        }
        .tabList{
            text-align: center;
        }
        .DCCTabsTable{
            width:100%;
        }
        .DCCTabsTable tr{
            height:40px;
        }
        .queryCondition #dd{
            left:50px;
            top:0px;
        }
        .searchSureBtn,.toExcell{
            /*line-height: 80px;*/
            margin-top: 20px;
            height:30px;
            width:60px;
            line-height: 30px;
            /* margin-right: 30px;*/
            float:right;
            background-color: #eee;
            /* //font-family: '微软雅黑', sans-serif;*/
            font-weight: 500;
            margin-right:50px ;
            font-size: 14px;
            text-decoration: none;
            font-weight: 500;
            color: #333;
            position: relative;
            /*padding: 8px 15px;*/
            /* margin-right: 15px;*/
            border-top-right-radius: 10px;
            border-bottom-right-radius: 10px;
            border-top-left-radius: 10px;
            border-bottom-left-radius: 10px;
            background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(242,242,242)), color-stop(1, rgb(242,242,242)) );
            cursor: pointer;
            overflow: hidden;
        }
        .toExcell{
            width:90px;
            display:none;
        }
        .searchSureBtn:hover,.toExcell:hover{
            color:#fff;
            background:#40E0D0;
        }
        .calendar-hd{
            height:40px;
        }
        #dd{
            left: 50px !important;
            top: 50px !important;
        }
        #tt{
            left: 360px !important;
            top: 50px !important;
        }
        .layui-input, .layui-textarea {
            font-size: 14px;
        }
        .boxContainer {
            background: #fff;
            border:none;
            box-sizing: border-box;
            width: 100%;
            position: relative;
              top: 5px;
            border-bottom: 0;
            left: 10px;
            height: 98%;
           /* position:relative;*/
        }
        .titleName{
            display: block;
            float:left;
            clear: both;
            height:20px;
            line-height: 80px;
       /*     padding-right: 10px;*/
            margin-left:10px;
            font-size: 14px;
            margin-right: 30px;
        }
        .layui-form{
            float:right;
            margin-bottom: 10px;
            margin-left: -13px;
        }
        .table_tbody_box{
            height:auto;
            /*overflow-y: scroll;*/
        }
        .table_tbody_box center{
            margin-top:-10px;
        }
        .layui-table tr td a{
            float:left;
            width:100%;
            overflow: hidden;
            text-overflow:ellipsis;
            white-space: nowrap;
            width:auto;
            max-width:180px;
           /* padding:0 0px;*/
            color:#0000FF;
            cursor: pointer;
            text-decoration:underline;
            text-align: left;
        }
        .layui-table tr td span{
            display:none;
        }
        .layui-table tr td{
            height:40px;
            line-height: 40px;
            overflow: hidden;
            text-overflow:ellipsis;
            white-space: nowrap;
        }
        .layui-table tr .td4{
            text-align: left;
        }
        .bgClassBox{
            width:100%;
            height:100%;
        }
        .table_tbody_box center #pageBar2{
            position:absolute;
            bottom:0px;
            width:100%;
            text-align: center;
            display:none;
        }
        .layui-table[lay-size=sm] td, .layui-table[lay-size=sm] th {
            font-size: 12px;
            padding: 5px 4px;
        }
        .selectedItem:first-child{
            margin-left:50px;
            padding-right: 50px;
        }
        .lastSelectedItem{
            margin-left:50px;
        }
      .ui-multiselect span{
            font-size: 14px;
            color:#666;
        }
        .layui-table tr td:first-child+td+td, .layui-table tr th:first-child+th+th
        /*.layui-table tr td:first-child+td+td+td, .layui-table tr th:first-child+th+th+th,*/
        /*.layui-table tr td:first-child+td+td+td+td+td, .layui-table tr th:first-child+th+th+th+th+th*/{
            max-width: 230px;
            width:230px;
        }
        .layui-table tr td, .layui-table tr td{
            max-width: 110px;
            width: 110px;
            overflow: hidden;
            text-overflow:ellipsis;
            white-space: nowrap;
        }
        /*.layui-table tr .td10, .layui-table tr th:nth-child(10){
            min-width: 36px;
            width:36px;
        }*/
        .tab{
            min-width: 0;
        }

        #table_tbody_box{
            position:absolute;
        }
        .layform4{
            margin-top:0;
        }
        #select_ms,#select1_ms,#select2_ms,#select3_ms,#select4_ms{
            cursor: pointer;
            background: #fff;
            border: 1px solid #ccc;
            position: absolute;
           /* top: 3px;*/
            width: 200px;
            height: 35px;
            line-height:35px;
            max-width: 150px;
            margin-top: 8px;
        }
        #select1_ms,#select2_ms,#select3_ms,#select4_ms,#select2_ms{
            margin-top: 20px;
        }
        #select_ms{
            margin-left:40px;
        }
        .wdType{
            margin-right:40px;
        }
        .lastSelectedItem .titleName{
            margin-right:44px;
        }
        .ui-multiselect-menu ul {
            width:200px;
        }
        .ui-multiselect-menu li span{
            /*display: inline-block;*/
            width:100%;
            padding-left:10px;
            text-overflow:ellipsis;
            font-size: 12px;
           /* white-space: nowrap;*/
        }
        .ui-multiselect-checkboxes li {
            min-height: 30px;
            line-height: 30px;
            height: auto;
            /* line-height: 20px; */
            clear: both;
            font-size: 0.8em;
            list-style: none;
            margin: 0 auto;
            margin-left: 4px;
            padding-right: 4px;
            /* width: 300px; */
            border-bottom: 1px solid #ccc;
        }
        .ui-multiselect-header ul {
            font-size: 0.9em;
             display: block;
            background: #fff;
            border: 2px solid #ccc;
            border-top: 0;
            border-bottom: 0;
            max-height: 60px;
            height: 30px;
        }
    </style>

</head>
<body>
<div class="boxContainer">
    <div id="loading">
        <img src='../styles/img/loading.gif' />
    </div>
    <div class="bgClassBox">
        <div class="tab side1 tabClass">
            <div class="queryCondition"><i style="font-style:normal;margin-right:5px;margin-left:5px;">日期：</i><span class="spanBox"><i style="font-style:normal; margin-right:35px;margin-left:6px;"><i style="color:red;eidth:4px;">*</i>From:</i><input class="dataInput" type="text"  id="dt" placeholder="开始日期">
            <i style="font-style:normal;margin-right:60px;margin-left:65px;">To:</i><input class="dataInput" type="text" id="dt1" placeholder="截止日期"><i style="font-style:normal ;margin-right:42px;margin-left:50px;">文档名称:</i><input class="" type="text" id="dt2" placeholder="请输入文档名称"><i style="font-style:normal ;/*margin-right:40px*/;margin-left:50px;">生产地:</i><select id='select' multiple="multiple"></select>

                </span>
                <div id="dd"></div>
                <div id="tt"></div>
                <div style="clear: both;height:60px;">
                    <span class="selectedItem">
                        <span class="titleName">产品库:</span><select id='select1' multiple="multiple"></select>
                    </span>
                    <span class="selectedItem">
                        <span class="titleName">研发地:</span><form class="layui-form layform2" action=""> <div class="layui-form-item proSelect"> <div class="layui-input-block editWidth"> <select class="select2" name="" lay-verify="" lay-filter="select2"> <option value=""></option> </select> </div> </div></form>
                    </span>
                    <span class="selectedItem">
                        <span class="titleName wdType">工艺文件:</span><select id='select2' multiple="multiple"></select>
                    </span>
                    <span class="selectedItem">
                        <span class="titleName">受控PDF图纸:</span><select id='select3' multiple="multiple"></select>
                    </span>
                    <span class="selectedItem lastSelectedItem">
                        <span class="titleName">状态:</span><select id='select4' multiple="multiple"></select>
                    </span>
                    <button class="toExcell">导出Excel</button>
                    <button class="searchSureBtn">搜索</button>
                </div>

                <div style="clear: both"></div>
            </div>

            <div class="table_tbody_box">

            </div>

        </div>
    </div>
</div>
<script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
<script src="../js/json2.js"></script>
<script src="../js/common/publicClass.js"></script>
<script src="../layer/layer.js" charset="utf-8"></script>
<script type="text/javascript" src="../js/constants/calendar.js"></script>
<script type="text/javascript" src="../js/common/utils.js"></script>
<script type="text/javascript" src="../js/common/myAjax.js"></script>
<script language="Javascript" src="../jqueryNicepage/js/layui.js"></script>
<script type="text/javascript" src="../js/common/jquery-ui.min.js"></script>
<script type="text/javascript" src="../js/common/jquery.multiselect.js"></script>
<script type="text/javascript" src="../js/pages/dccQuery/selects.js"></script>
<script>

    window.onload=function(){
        maximizeWindow();//设置屏幕大小
        var sxdArr=[];//生产地多选款数据；
        var cpkArr=[];//产品库多选款数据；
        var wdlxArr=[];//工艺文件多选数据；
        var pdfNumArr=[];//PDF受控图纸编号；
        var statesArr=[];//状态；
        selectInit("select","生产地",sxdArr,function(str){
            sxdArr=str
        });
        selectInit("select1","产品库",cpkArr,function(str){
            cpkArr=str
        });
        selectInit("select2","工艺文件",wdlxArr,function(str){
            wdlxArr=str
        });
        selectInit("select3","受控PDF图纸",pdfNumArr,function(str){
            pdfNumArr=str
        });
        selectInit("select4","状态",statesArr,function(str){
            statesArr=str
        });
        /*var heightform=$(".boxContainer").height()-$(".queryCondition").height()-20;
        $(".table_tbody_box").css("height",heightform*0.90);*/
        var forCallbackVal="";
        $("#loading").css({
            display:"block"
        });
        //var docTypesArr=["正式图纸","临时图纸","工艺文件"]
       /* renderForm([],"1");
        renderForm([],"2");*/
        //renderForm(docTypesArr,"3")
        MaterialReverseAjax("/GetProducts/getProducts","",function(str){
            $("#loading").css({
                display:"none"
            });
            if(str.data!=undefined&&str.data.length>0){
                getSelectData(str.data,"select1")

               // renderForm(str.data,"1","","select1")
            }

        });
        MaterialReverseAjax("/GetResearchSite/getResearchSite","",function(str){
            $("#loading").css({
                display:"none"
            });
            if(str.data!=undefined){
                var datalist=[];
                for(var v in str.data){
                    datalist.push(str.data[v]);
                }
                renderForm(datalist,"2","obj","select2",function(str){
                    forCallbackVal=str;

                })
            }

        });
        MaterialReverseAjax("/GetResearchSite/getResearchSite","",function(str){
            $("#loading").css({
                display:"none"
            });
            if(str.data!=undefined){
                var datalist=[];
                for(var v in str.data){
                    datalist.push(str.data[v]);
                }
                getSelectData(datalist,"select");

                //renderForm(datalist,"4","obj","select4",formCallbackPlace)
            }

        });
        MaterialReverseAjax("/DCCGetDrawingType/getDrawingType","",function(str){
            $("#loading").css({
                display:"none"
            });
            if(str.data!=undefined){
                /*var datalist=[];
                for(var v in str.data){
                    datalist.push(str.data[v]);
                }*/
                getSelectData(str.data,"select2")

            }

        });
        MaterialReverseAjax("/GetControlDocumentNum/getControlDocumentNum","",function(str){
            $("#loading").css({
                display:"none"
            });
            if(str.data!=undefined){
                /*var datalist=[];
                for(var v in str.data){
                    datalist.push(str.data[v]);
                }*/
                getSelectData(str.data,"select3")

            }

        });
        MaterialReverseAjax("/GetStates/getStates","",function(str){
            $("#loading").css({
                display:"none"
            });
            if(str.data!=undefined){
                getSelectData(str.data,"select4");
                //getValue();
               // statesArr=delectAllselectVal(statesArr,".ui-multiselect-menu");
            }

        });
        $(".formContent").css({
            "height":($(".bgClassBox").height()-137)+"px"
        })
        $('#dd').calendar({
            trigger: '#dt',
            zIndex: 999999999999999,
            format: 'yyyy-mm-dd',
            onSelected: function (view, date, data) {
            },
            onClose: function (view, date, data) {
                var nowData=splitDataTime(getNowFormatDate().split(" ")[0]) ;
                var dat=$('#dt').val();
                var thisData=splitDataTime(dat);
                if(parseInt(thisData)>parseInt(nowData)){
                    $('#dt').val("");
                }
                getTimeFn();
            }
        });

        $('#tt').calendar({
            trigger: '#dt1',
            zIndex: 9999999999999,
            format: 'yyyy-mm-dd',
            onSelected: function (view, date, data) {
            },
            onClose: function (view, date, data) {
                getTimeFn();
            }
        });
        //判断起止时间是否符合格式要求，结束时间不得早于开始时间
        function getTimeFn(){
            if($('#dt').val()!=""&&$('#dt1').val()){
                var time=splitDataTime($('#dt').val())
                var num= parseInt(time) ;

                var time1=splitDataTime($('#dt1').val())

                var num1= parseInt(time1) ;

                if(num1<num){
                    $("#dt1").val("");
                    $("#dt").val("");
                    layerFn("时间格式不正确，截止时间不能早于开始时间。")
                }
            }
        }
        var docType="",
            startdate="",
            enddate="",
            modulesDevelopedLand="",
            placeLand="",
            selectVal="",
            docName="",
            controlDocumentNum="",//PDF
            states="";
        $(".toExcell").click(function(){
            $("#loading").css({
                display:"block"
            });

            //var selectVal=$(".layform3 input").val()?$(".layform3 input").val():"";
            var data="docType="+encodeURIComponent(docType)+"&startdate="+encodeURIComponent(startdate)+"&enddate="+encodeURIComponent(enddate)+"&repository="+encodeURIComponent(selectVal)+"&modulesDevelopedLand="+encodeURIComponent(modulesDevelopedLand)+"&docName="+encodeURIComponent(docName)+"&moduleOrigin="+encodeURIComponent(placeLand)+"&controlDocumentNum="+controlDocumentNum+"&states="+states;
            //var data="docType=111&&repository=Asi&&startdate=2018-01-01&&enddate=2018-12-16"
            MaterialReverseAjax("/DCCInquireStatementController/DCCWriteExcel",data,function(str){
                $("#loading").css({
                    display:"none"
                })
                if(str.path!=undefined&&str.path!=""){
                    //window.open(str.path);
                    window.location.href=str.path;
                }
            })

        })
        function SplicingParameter(data){
            var text="";
            if(data!=undefined&&data.length>0){
                for(var i=0;i< data.length;i++){
                    if(i!=(data.length-1)){
                        text+=data[i]+";"
                    }else{
                        text+=data[i]
                    }

                }
            }
           return text;
        }
        $(".searchSureBtn").click(function(){
            startdate=$("#dt").val()?$("#dt").val():"";//开始时间
            enddate=$("#dt1").val()?$("#dt1").val():"";//结束时间
            docName=$("#dt2").val().replace(/\s+/g,"");//$(".publicInputText").val().replace(/\s+/g,"")
            docType=SplicingParameter(wdlxArr);//工艺文件
            modulesDevelopedLand=forCallbackVal;//研发地
            controlDocumentNum=SplicingParameter(pdfNumArr);//PDF；
            states=SplicingParameter(statesArr);//状态
            placeLand=SplicingParameter(sxdArr);//生产地
            selectVal=SplicingParameter(cpkArr);//产品库
            if(controlDocumentNum!=""&&docType!=""){
                layerFn("工艺文件和受控PDF图纸不能同时输入");
                return;
            }
            if(controlDocumentNum!=""&&docName!=""){
                layerFn("文档名称和受控PDF图纸不能同时输入");
                return;
            }
            if(startdate!=""){
                $("#loading").css({
                    display:"block"
                });

                var data="docName="+encodeURIComponent(docName)+"&docType="+encodeURIComponent(docType)+"&startdate="+startdate+"&enddate="+enddate+"&repository="+encodeURIComponent(selectVal)+"&modulesDevelopedLand="+encodeURIComponent(modulesDevelopedLand)+"&moduleOrigin="+encodeURIComponent(placeLand)+"&controlDocumentNum="+controlDocumentNum+"&states="+states;
                //var data="docType=111&&repository=Asi&&startdate=2018-01-01&&enddate=2018-12-16"
                MaterialReverseAjax("/DCCInquireStatementController/DCCInquireStatement",data,function(str){
                    $("#loading").css({
                        display:"none"
                    })
                    if(str.data!=undefined&&str.data.length>0){
                        var datalist=[];
                        for(var i=0;i<str.data.length;i++) {
                            var dataobj={};
                            dataobj.Item1=str.data[i].Item1+"|"+str.data[i].partUrl+"{}";
                            dataobj.name=str.data[i].name+"|"+str.data[i].docUrl+"{}";
                            dataobj.productType1=str.data[i].productType1;
                            dataobj.version=str.data[i].version;
                            dataobj.folder=str.data[i].folder;
                            dataobj.drawingType=str.data[i].drawingType;
                            dataobj.releaseTime=str.data[i].releaseTime;
                            dataobj.updateBy=str.data[i].updateBy;
                            dataobj.modulesDevelopedLand1=str.data[i].modulesDevelopedLand1;
                            dataobj.moduleOrigin1=str.data[i].moduleOrigin1;
                            dataobj.type=str.data[i].type;
                            dataobj.productState=str.data[i].productState;
                            datalist.push(dataobj);
                        }
                        if(datalist.length>10){
                            /*$(".table_tbody_box").css({
                                "height":($(".commonSide").height()-100),
                                "overflow-y": "scroll"
                            })*/
                        }
                        $(".toExcell").css({
                            "display":"block"
                        })
                        var heightform=$(".boxContainer").height()-$(".queryCondition").height()-20;
                        $(".table_tbody_box").css({
                            "max-height":heightform*0.80,
                            "overflow-y":"scroll"
                        });
                        window.historyList1=datalist;
                        window.headers1=["序号","料号<i title='升序' class='iconfont down'>&#xe604;</i>","文档名称", "型号", "版号", "存储位置","图纸类型", "生效日期", "拟制人", "研发地", "生产地", "临时图纸", "状态"] //table的列名
                        window.widths1=["100","100","300","200","100","200","100","100","100","100","100","100","100"]
                        $(".table_tbody_box").empty().load('./newTable.html',"",function(){
                            setTimeout(function(){
                                var heightform=$(".boxContainer").height()-$(".queryCondition").height()-20;
                                if($(".table_tbody_box")[0].offsetHeight>(heightform*0.80)){
                                    $("#pageBar2").css("top",heightform*0.80+$(".queryCondition").height()+20)
                                }else{
                                    $("#pageBar2").css("top",$(".table_tbody_box")[0].offsetHeight+$(".queryCondition").height()+40);
                                }
                                $("#pageBar2").css("display","block")
                                clearTimeout();
                            },200)
                        });
                    }else{
                        $(".table_tbody_box").empty();
                        $(".toExcell").css({
                            "display":"none"
                        })
                        layerFn("您查询的数据不存在！")
                    }


                })
            }else{
                layerFn("请选择开始日期！")
            }
        })

        window.onscroll=function(){
            var scrollTop= $(".table_tbody_box").scrollTop();
            if(scrollTop>0){
               // console.log(scrollTop);
            }
        }
    }
    //var docType="";
    $(".table_tbody_box").scroll(function() {
        var scrolltop=$(this).scrollTop();
        if(scrolltop>0){
            $("#table2 table thead").css({
                "position":"absolute",
                "background":"#f2f2f2",
                "opacity":"1",
                "z-index": 1,
                "top":$(".queryCondition")[0].offsetHeight+10+"px"
            })
        }else{
            $("#table2 table thead").css({
                "position":""

            })
        }
        for (var i = 0; i <  window.headers1.length; i++) {
            var width = $("#table2 table tbody tr:first-child td").eq(i).width();
            var offsetWidth=$("#table2 table tbody tr:first-child td").eq(i)[0].offsetWidth
          //  var width = $("#table2 table tbody tr:first-child td").eq(i).width();
            $("#table2 table thead tr").css({
                "width":$("#table2 table").width()
            })
            if(IEVersion()>(8)){
                $("#table2 .layui-table thead tr:first-child th").eq(i).css({
                    "width":width
                })

            }else{
                    $("#table2 .layui-table thead tr:first-child th").eq(i).css({
                        "width":width+1
                    })

            }
        }

    })
    $("body").unbind().on("click",".layui-table tr td a",function(){
        if($(this).parent().attr("class")!="td5"){
            var url=$(this).attr("data-num")!=undefined&&$(this).attr("data-num")!=""?$(this).attr("data-num"):"";
            if(url!=""){
                window.open(url)
            }

        }

    })
    $(window).resize(function () { //当浏览器大小变化时
        //console.log($("#table2 table").width())
        $("#table2 table thead tr").css({
            "width":$("#table2 table").width()
        })
        var heightform=$(".boxContainer").height()-$(".queryCondition").height()-20;
        $(".table_tbody_box").css({
            "max-height":heightform*0.80,
            "overflow-y":"scroll"
        });
        if($(".table_tbody_box")[0].offsetHeight>(heightform*0.80)){
            $("#pageBar2").css("top",heightform*0.80+$(".queryCondition").height()+20)
        }else{
            $("#pageBar2").css("top",$(".table_tbody_box")[0].offsetHeight+$(".queryCondition").height()+40);
        }
        setTimeout(function(){
            var heightform=$(".boxContainer").height()-$(".queryCondition").height()-20;
            if($(".table_tbody_box")[0].offsetHeight>(heightform*0.80)){
                $("#pageBar2").css("top",heightform*0.80+$(".queryCondition").height()+20)
            }else{
                $("#pageBar2").css("top",$(".table_tbody_box")[0].offsetHeight+$(".queryCondition").height()+40);
            }

            clearTimeout();
        },100)
        for (var i = 0; i <  window.widths1.length; i++) {
            var width = $("#table2 table tbody tr:first-child td").eq(i).width();

            if(IEVersion()>(8)){
                $("#table2 .layui-table thead tr:first-child th").eq(i).css({
                    "width":width
                })

            }else{
                $("#table2 .layui-table thead tr:first-child th").eq(i).css({
                    "width":width+1
                })

            }
        }
    });
    $(".table_tbody_box").on("click","thead tr th:first-child +th",function(){
        if($(this).find("i")==undefined){
            return;
        }
        $("#loading").css({
            display:"block"
        });
        $("#pageBar").css({
            display:"none"
        });
        var className=$(this).find("i").attr("class").split(" ")[1];
        if(className=="up"){
            var icon=["序号","料号<i title='升序' class='iconfont down'>&#xe604;</i>","文档名称", "型号", "版号", "存储位置","图纸类型", "生效日期", "拟制人", "研发地", "生产地", "临时图纸", "状态"] //table的列名
            window.historyList1=window.historyList1.sort(compareUp(window.historyList1,"Item1"));
        }else if(className=="down"){
            var icon=["序号","料号<i title='升序' class='iconfont up'>&#xe64d;</i>","文档名称", "型号", "版号", "存储位置","图纸类型", "生效日期", "拟制人", "研发地", "生产地", "临时图纸", "状态"] //table的列名
          //  var icon=["全选","序号","受影响对象料号"+"<i title='从大到小' class='iconfont up'>&#xe64d;</i>","视图"+"<i title='从大到小' class='iconfont up'>&#xe64d;</i>","受影响对象状态"];
            window.historyList1=window.historyList1.sort(compareDown(window.historyList1,"Item1"));
        }


        window.headers1=icon;
        $(" .table_tbody_box").empty();
        //$(".searchContainer").append('<div class="formContent"></div>')
        $(".table_tbody_box").empty().load('./newTable.html',"",function(){
            $("#loading").css({
                display:"none"
            });
            setTimeout(function(){
                var heightform=$(".boxContainer").height()-$(".queryCondition").height()-20;
                if($(".table_tbody_box")[0].offsetHeight>(heightform*0.80)){
                    $("#pageBar2").css("top",heightform*0.80+$(".queryCondition").height()+20)
                }else{
                    $("#pageBar2").css("top",$(".table_tbody_box")[0].offsetHeight+$(".queryCondition").height()+40);
                }
                $("#pageBar2").css("display","block")
                clearTimeout();
            },200)
        });
    })
</script>
</body>
</html>